package com.woniuxy.yoga.course.client;

import com.woniuxy.yoga.commons.core.model.Result;
import com.woniuxy.yoga.course.client.dto.progress.Expcard;
import com.woniuxy.yoga.course.client.dto.progress.Lifecard;
import com.woniuxy.yoga.course.client.dto.progress.Moncard;
import com.woniuxy.yoga.course.client.dto.progress.Subcard;
import com.woniuxy.yoga.course.client.form.GetUnfinishPriByIdForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 进度服务的访问类
 */
@FeignClient(name = "progress-service",path = "/progress")
public interface ProgressClient {

    /**
     * 查询用户未完成体验卡
     * @param userId userid
     * @return Expcard
     */
    @GetMapping("/expcard/selectUnfinishExp/{userId}")
    public Result<Expcard> selectExpcardUnfinishExp(@PathVariable("userId") Integer userId);

    /**
     * 查询未完成次卡进度
     * @param userId userId
     * @return Subcard
     */
    @GetMapping("/subcard/getUnfinishSub/{userId}")
    public Result<List<Subcard>> getSubcardUnfinishSub(@PathVariable("userId") Integer userId);

    /**
     * 查询未完成月卡进度
     * @param userId userid
     * @return Moncard
     */
    @GetMapping("/moncard/getUnfinishMon/{userId}")
    public Result<List<Moncard>> getMoncardUnfinishMon(@PathVariable("userId") Integer userId);

    /**
     * 通过用户id查询终身卡进度
     * @param userId 用户id
     * @return Lifecard
     */
    @GetMapping("/lifecard/getByUserId/{userId}")
    public Result<Lifecard> getLifecardByUserId(@PathVariable("userId") Integer userId);

    /**
     * 完成体验课
     * @param expcardId 参数
     */
    @GetMapping("/expcard/finishExpcard/{expcardId}")
    public Result<?> finishExpcard(@PathVariable("expcardId") Integer expcardId);

    /**
     * 次卡进度次数加一
     * @param subcardId 次卡id
     * @return string
     */
    @GetMapping("/subcard/addSubCardCount/{subcardId}")
    public Result<String> addSubCardCount(@PathVariable("subcardId") Integer subcardId);

    /**
     * 终身卡次数加1
     * @return string
     */
    @GetMapping("/lifecard/addLifeCardCount/{lifecardId}")
    public Result<String> addLifeCardCount(@PathVariable("lifecardId") Integer lifecardId);

    /**
     * 次卡进度次数减一
     * @param subcardId 次卡id
     * @return string
     */
    @GetMapping("/subcard/reduceSubCardCount/{subcardId}")
    public Result<String> reduceSubCardCount(@PathVariable("subcardId") Integer subcardId);

    /**
     * 终身卡次数减1
     * @return string
     */
    @GetMapping("/lifecard/reduceLifeCardCount/{lifecardId}")
    public Result<String> reduceLifeCardCount(@PathVariable("lifecardId") Integer lifecardId);

    /**
     * 私教进度次数加一
     * @param pricardId 私教id
     * @return string
     */
    @GetMapping("/pricard/addPriCardCount/{pricardId}")
    public Result<String> addPriCardCount(@PathVariable("pricardId") Integer pricardId);

    /**
     * 查询未完成私教卡
     * @param form form
     * @return Pricard
     */
    @PostMapping("/pricard/getUnfinishPriById")
    public Result<Integer> getUnfinishPriById(@RequestBody GetUnfinishPriByIdForm form);
}
